package com.yundingai.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * 自习室分类：用于筛选自习室
 * @TableName room_category
 */
@TableName(value ="room_category")
@Data
public class RoomCategory {
    /**
     * 分类id
     */
    @TableId(type = IdType.AUTO)
    private Integer catId;

    /**
     * 分类名称
     */
    private String catName;

    /**
     * 描述
     */
    private String catDesc;

    /**
     * 图标
     */
    private String catIcon;

    /**
     * 索引权重
     */
    private Integer sortOrder;

    /**
     * 是否启用:0.未启用  1.正常启用
     */
    private Integer isAvaliable;

    /**
     * 创建者
     */
    private String creator;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新人
     */
    private String updater;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RoomCategory other = (RoomCategory) that;
        return (this.getCatId() == null ? other.getCatId() == null : this.getCatId().equals(other.getCatId()))
            && (this.getCatName() == null ? other.getCatName() == null : this.getCatName().equals(other.getCatName()))
            && (this.getCatDesc() == null ? other.getCatDesc() == null : this.getCatDesc().equals(other.getCatDesc()))
            && (this.getCatIcon() == null ? other.getCatIcon() == null : this.getCatIcon().equals(other.getCatIcon()))
            && (this.getSortOrder() == null ? other.getSortOrder() == null : this.getSortOrder().equals(other.getSortOrder()))
            && (this.getIsAvaliable() == null ? other.getIsAvaliable() == null : this.getIsAvaliable().equals(other.getIsAvaliable()))
            && (this.getCreator() == null ? other.getCreator() == null : this.getCreator().equals(other.getCreator()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCatId() == null) ? 0 : getCatId().hashCode());
        result = prime * result + ((getCatName() == null) ? 0 : getCatName().hashCode());
        result = prime * result + ((getCatDesc() == null) ? 0 : getCatDesc().hashCode());
        result = prime * result + ((getCatIcon() == null) ? 0 : getCatIcon().hashCode());
        result = prime * result + ((getSortOrder() == null) ? 0 : getSortOrder().hashCode());
        result = prime * result + ((getIsAvaliable() == null) ? 0 : getIsAvaliable().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", catId=").append(catId);
        sb.append(", catName=").append(catName);
        sb.append(", catDesc=").append(catDesc);
        sb.append(", catIcon=").append(catIcon);
        sb.append(", sortOrder=").append(sortOrder);
        sb.append(", isAvaliable=").append(isAvaliable);
        sb.append(", creator=").append(creator);
        sb.append(", createTime=").append(createTime);
        sb.append(", updater=").append(updater);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}